package com.ysd.lis.controller.bac;


import com.ysd.common.Result;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.entity.bac.BacWorkFlowNode;
import com.ysd.lis.request.bac.BacFlowNodeDto;
import com.ysd.lis.service.bac.BacWorkFlowNodeService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 流程设定主表 前端控制器
 * </p>
 *
 * @author cfz
 * @since 2024-04-09
 */
@RestController
@RequestMapping("/api/bac/bac-work-flow-node")
public class BacWorkFlowNodeController extends BaseController {
    @Autowired
    BacWorkFlowNodeService bacWorkFlowNodeService;

    @ApiOperation("查询")
    @GetMapping("/findBacWorkFlowNodeList")
    public Result findBacWorkFlowNodeList(BacWorkFlowNode bacWorkFlowNode) {
        return bacWorkFlowNodeService.findBacWorkFlowNodeList(bacWorkFlowNode);
    }

    @ApiOperation("增加")
    @PostMapping("/addBacWorkFlowNode")
    public Result addBacWorkFlowNode(@RequestBody BacWorkFlowNode bacWorkFlowNode) {
        return bacWorkFlowNodeService.addBacWorkFlowNode(bacWorkFlowNode);
    }

    @ApiOperation("删除")
    @PostMapping("/deleteBacWorkFlowNode")
    public Result deleteBacWorkFlowNode(@RequestBody BacWorkFlowNode bacWorkFlowNode) {
        return bacWorkFlowNodeService.deleteBacWorkFlowNode(bacWorkFlowNode);
    }

    @ApiOperation("修改")
    @PostMapping("/updateBacWorkFlowNode")
    public Result updateBacWorkFlowNode(@RequestBody BacWorkFlowNode bacWorkFlowNode) {
        return bacWorkFlowNodeService.updateBacWorkFlowNode(bacWorkFlowNode);
    }

    @ApiOperation("修改")
    @PostMapping("/saveOrUpdateBacWorkFlowNode")
    public Result saveOrUpdateBacWorkFlowNode(@RequestBody BacFlowNodeDto dto) {
        return bacWorkFlowNodeService.saveOrUpdateBacWorkFlowNode(dto);
    }
}
